<!-- 使用 type="home" 属性设置首页，其他页面不需要设置，默认为page；推荐使用json5，更强大，且允许注释 -->
<route lang="json5" type="home">
{
  layout: 'default',
  style: {
    navigationBarTitleText: 'Launch Screen',
    navigationStyle: 'custom',
  },
}
</route>

<template>
  <view class="flex flex-col h-[100vh]">
    <view class="flex flex-col items-center justify-center h-full gap-50">
      <view>
        <wd-img class="w-35" src="/static/images/ic_eshop.png" mode="widthFix"></wd-img>
      </view>
      <view class="flex flex-col items-center justify-center">
        <text>{{ countDown }}</text>
        <wd-img src="/static/images/ic_title.png" mode="widthFix" class="w-30" />
        <text class="text-neutral-5 text-xl font-bold tracking-[24rpx]">购物总有新玩法</text>
      </view>
    </view>
  </view>
</template>

<script lang="ts" setup>
const countDown = ref(2)

onMounted(() => {
  const timer = setInterval(() => {
    countDown.value--
    if (countDown.value <= 0) {
      clearInterval(timer)
      // 跳转到首页
      uni.switchTab({ url: '/pages/index/index' })
    }
  }, 1000)
})
</script>

<style lang="scss" scoped>
//
</style>
